home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Texteditors / Origami / bindings / fun / skippara < prev    next >
Encoding:
Text File  |  1996-09-27  |  2.3 KB  |  98 lines

  1. ;OCL{{{}}}
  2. ;OCL{{{  comments
  3. ; skip roff-paragraphs up and down
  4. ;OCL}}}
  5. @if-using not(ocl-file-skippara)
  6.    @use (ocl-file-skippara)
  7.    ;OCL{{{  libs
  8.    @if-using not(ocl-file-error) @lib error @fi
  9.    ;OCL}}}
  10.    ;OCL{{{  vars
  11.    ( defvar
  12.       ( fill-x       ; help
  13.         single-blank ; help, which fill-para-mode?
  14.         fill-begin   ; used as help
  15.       )
  16.    )
  17.    ;OCL}}}
  18.    ;OCL{{{  previous-paragraph
  19.    (deffun previous-paragraph (
  20.      if in-prompt (return-from-macro) fi
  21.      previous-line
  22.      set fill-x 0
  23.      ;OCL{{{  skip comments
  24.      while =(fill-x 0) (
  25.        while not(or(test-bottom,test-text)) (
  26.          if test-fold-line (
  27.            open-fold
  28.            while not(test-end-fold) (next-line)
  29.          ) fi
  30.          previous-line
  31.        )
  32.        beginning-of-line
  33.        if not(and(test-char ". =(single-blank 0))) (
  34.          set fill-x 1
  35.        ) else (
  36.          previous-line
  37.        ) fi
  38.      )
  39.      ;OCL}}}
  40.      beginning-of-line
  41.      set fill-x 0
  42.      ;OCL{{{  skip current paragraph
  43.      while =(fill-x 0) (
  44.        if or(test-char "  ;
  45.              and(test-char ". =(single-blank 0)),
  46.              not(test-begin-line))
  47.        (
  48.          set fill-x 1
  49.          next-line
  50.        ) else (
  51.          previous-line
  52.          if test-top ( failed ) fi
  53.        ) fi
  54.      )
  55.      ;OCL}}}
  56.    ))
  57.    ;OCL}}}
  58.    ;OCL{{{  next-paragraph
  59.    (deffun next-paragraph (
  60.      if in-prompt (return-from-macro) fi
  61.      beginning-of-line
  62.      ;OCL{{{  skip current paragraph
  63.      set fill-begin store-pos
  64.      if test-text (set fill-x 1) else (set fill-x 0) fi
  65.      while >(fill-x 0) (
  66.        goto-counter fill-begin
  67.        if or(test-char "  ;
  68.              and(test-char ". =(single-blank 0)),
  69.              not(test-begin-line))
  70.        (
  71.          set fill-x 0
  72.        ) else (
  73.          next-line
  74.        ) fi
  75.      )
  76.      ;OCL}}}
  77.      ;OCL{{{  skip 'comments'
  78.      while =(fill-x 0) (
  79.        while not(or(test-bottom,test-text)) (
  80.          if test-fold-line ( open-fold ) fi
  81.          next-line
  82.        )
  83.        beginning-of-line
  84.        if not(and(test-char ". =(single-blank 0))) (
  85.          set fill-x 1
  86.        ) else (
  87.          next-line
  88.        ) fi
  89.      )
  90.      ;OCL}}}
  91.      if not(test-text) ( failed ) fi
  92.    ))
  93.    ;OCL}}}
  94.    ;OCL{{{  undeclare
  95.    ( undeclare ( fill-x single-blank fill-begin ) )
  96.    ;OCL}}}
  97. @fi
  98.